<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
                      "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml"
      xmlns:py="http://genshi.edgewall.org/"
      xmlns:xi="http://www.w3.org/2001/XInclude">
<?python from genshi import HTML ?>
<?python
from tg.i18n import get_lang
from tg import url
from babel.dates import format_date
from tg import request
host = request.headers.get('Host')
?>
<head>
	<meta content="text/html; charset=UTF-8" http-equiv="content-type" />
  	<title></title>
	${tmpl_context.pack()}
  	${tmpl_context.googlemaps_js()}
	<script type="text/javascript">
    google.load("maps", "2");
    </script>

    <link rel="stylesheet" type="text/css" media="screen" href="${tg.url('/css/style.css')}" />

 <script type="text/javascript">
 /*<![CDATA[*/
    var map;
    var geoXml;
    var toggleState = 1;

	function initialize() {
  	  if (GBrowserIsCompatible()) {
  	    geoXml = new GGeoXml("http://${host}/feed?google_lat=${kw['google_lat']}&google_lng=${kw['google_lng']}");
        map = new GMap2(document.getElementById("map_canvas"));
        map.setCenter(new GLatLng(${kw['google_lat']}, ${kw['google_lng']}), 10);
        map.setUIToDefault();
        map.addOverlay(geoXml);
  	  }
	}

	function toggleMyKml() {
  	  if (toggleState == 1) {
    	map.removeOverlay(geoXml);
    	toggleState = 0;
  	  } else {
   		map.addOverlay(geoXml);
    	toggleState = 1;
  	  }
	}
	 /*]]>*/
    </script>

</head>
<body onload="initialize()">
<div id="toolbox_wrapper">
<div id="toolbox_main">
<div id="toolbox_content_body">
	<span><a href="/">Back to search form</a></span>

	<h1>
	<py:for each="attr in ['country_name_code','country_name','administrative_area_name', 'sub_administrative_area_name', 'locality_name']">
		<span py:if="kw.has_key(attr)">${kw[attr]} / </span>
	</py:for>
	</h1>
	<pre>Parameters: google_lat=${kw['google_lat']}, google_lng=${kw['google_lng']}</pre>
	<div id="map_canvas" style="width: 800px; height: 300px; float:left; border: 1px solid black;"></div>
    <br clear="all"/>
    <br/>
    <input type="button" value="Toggle Markers" onClick="toggleMyKml();"/>
    <br/>
	<h3>${kw['google_address']} (${len(hotels)} Hotels)</h3>
				<div py:for="hotel in hotels" id="post_content" style="border:solid 1px;margin:2px;padding:2px;">
					<h4><a href="${hotel.hotel_url}">${hotel.name}</a>
						<py:if test="hotel.star_rating"><py:for each="i in range(hotel.star_rating)">
															*</py:for></py:if>
						<py:if test="hotel.price_from">( price from ${hotel.price_from} )</py:if>
					</h4>
					<span><i>${hotel.address}</i></span>
					<div>${HTML(hotel.html_description)}</div>
					<hr/>
<pre>
<py:for each="key in hotel.__jsonlist__()">
	${key}: ${hotel.__json__()[key]}
</py:for>
</pre>
				</div>
</div>
</div>
</div>
</body>
</html>